package android.slc.user.ui.tree

import android.slc.extras.component.tree.entity.SlcTreeNav
import android.slc.user.R
import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 *
 * @Description:
 * @Author: sunlunchang
 * @CreateDate: 2022/09/02 上午 9:19
 *
 */
class UserTreeNavAdapter(data: MutableList<SlcTreeNav>) :
    BaseQuickAdapter<SlcTreeNav, BaseViewHolder>(
        R.layout.user_item_tree_nav, data
    ) {
    override fun convert(holder: BaseViewHolder, item: SlcTreeNav) {
        holder.setText(R.id.tv_name, item.treeName)
        val lastItem = holder.bindingAdapterPosition == itemCount - 1
        holder.getView<View>(R.id.tv_name).isSelected = lastItem
        holder.getView<View>(R.id.iv_more).isSelected = lastItem
    }
}